home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Flock 1.0 beta / flock-1.0RC3.en-US.win32.exe / flock / components / flockPhotoPerson.js < prev    next >
Text File  |  2007-10-18  |  3KB  |  87 lines

  1. //
  2. // BEGIN FLOCK GPL
  3. // 
  4. // Copyright Flock Inc. 2005-2007
  5. // http://flock.com
  6. // 
  7. // This file may be used under the terms of of the
  8. // GNU General Public License Version 2 or later (the "GPL"),
  9. // http://www.gnu.org/licenses/gpl.html
  10. // 
  11. // Software distributed under the License is distributed on an "AS IS" basis,
  12. // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. // for the specific language governing rights and limitations under the
  14. // License.
  15. // 
  16. // END FLOCK GPL
  17. //
  18.  
  19. const FLOCK_PHOTOPERSON_CID = Components.ID('{440dd9f3-cea2-41ad-af2b-cfc80ed4d5b5}');
  20. const FLOCK_PHOTOPERSON_CONTRACTID = '@flock.com/photo-person;1';
  21. const FLOCK_PHOTOPERSON_IID = Components.interfaces.flockIPhotoPerson;
  22.  
  23. // this maybe should be deprecated in favour of just using 
  24. // the coop object - ja
  25.  
  26. function flockPhotoPerson() {
  27. }
  28.  
  29. flockPhotoPerson.prototype= {
  30.     service: null,
  31.     username: "",
  32.     fullname: "",
  33.     id: "",
  34.     seq: 0,
  35.     lastNewSeq: 0,
  36.     photoCount: -1,
  37.  
  38.     QueryInterface: function(iid) {
  39.         if (!iid.equals(Components.interfaces.nsISupports) &&
  40.             !iid.equals(FLOCK_PHOTOPERSON_IID))
  41.             throw Components.results.NS_ERROR_NO_INTERFACE;
  42.         return this;
  43.     }
  44. };
  45.  
  46.  
  47. var flockPhotoPersonModule = {
  48.     registerSelf: function(compMgr, fileSpec, location, type) {
  49.         compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  50.         compMgr.registerFactoryLocation(FLOCK_PHOTOPERSON_CID, 
  51.                                         "flockPhotoPerson JS component", 
  52.                                         FLOCK_PHOTOPERSON_CONTRACTID, 
  53.                                         fileSpec, 
  54.                                         location,
  55.                                         type);
  56.     },
  57.  
  58.     getClassObject: function(compMgr, cid, iid) {
  59.         if (!cid.equals(FLOCK_PHOTOPERSON_CID))
  60.             throw Components.results.NS_ERROR_NO_INTERFACE;
  61.  
  62.         if (!iid.equals(Components.interfaces.nsIFactory))
  63.             throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  64.  
  65.         return flockPhotoPersonFactory;
  66.     },
  67.  
  68.     canUnload: function(compMgr) { return true; }
  69. };
  70.  
  71. var flockPhotoPersonFactory = {
  72.     createInstance: function(outer, iid) {
  73.         if (outer != null)
  74.             throw Components.results.NS_ERROR_NO_AGGREGATION;
  75.     
  76.         if (!iid.equals(FLOCK_PHOTOPERSON_IID) &&
  77.             !iid.equals(Components.interfaces.nsISupports))
  78.             throw Components.results.NS_ERROR_INVALID_ARG;
  79.  
  80.         return new flockPhotoPerson();
  81.     }
  82. }
  83.  
  84. /* module initialisation */
  85. function NSGetModule(comMgr, fileSpec) { return flockPhotoPersonModule; }
  86.  
  87.